﻿#region File Description
//-----------------------------------------------------------------------------
// BasicTaskToken
//
// Copyright © 2013 Wave Coorporation. All rights reserved.
// Use is subject to license terms.
//-----------------------------------------------------------------------------
#endregion

#region Using Statements
using System;
using System.Collections.Generic;
using System.Diagnostics;
using WaveEngine.Framework;
#endregion

namespace WaveEngine.Extensions.ITasks
{
    public class BasicTaskToken: TaskBase
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="BasicTaskToken" /> class.
        /// </summary>
        /// <param name="scene">The scene.</param>
        public BasicTaskToken(Scene scene,string name)
            : base(scene, name)
        {
 
        }

        /// <summary>
        /// Notifies the task completed.
        /// </summary>
        [DebuggerStepThrough]
        public void NotifyTaskCompleted()
        {
            base.performCompleted();
        }

        /// <summary>
        /// Notifies the cancelled.
        /// </summary>
        [DebuggerStepThrough]
        protected override void performCancel()
        {
            base.performCancel();
        }


        /// <summary>
        /// Notifies the skip.
        /// </summary>
        /// <returns></returns>
        [DebuggerStepThrough]
        protected override bool performSkip()
        {
            return base.performSkip();
        }

        /// <summary>
        /// Occurs when [on run].
        /// </summary>
        public event Action OnRun;

        /// <summary>
        /// Ons the run.
        /// </summary>
        [DebuggerStepThrough]
        protected override void performRun()
        {
            if (this.OnRun != null)
                OnRun();
        }

        /// <summary>
        /// Gets or sets the child tasks.
        /// </summary>
        /// <value>
        /// The child tasks.
        /// </value>
        public override IEnumerable<ITask> ChildTasks
        {
            get { return System.Linq.Enumerable.Empty<ITask>(); }
        }
    }
}
